package m.jclecai.com.adapter;

import android.support.v4.app.Fragment;
import android.support.v4.app.FragmentManager;
import android.support.v4.app.FragmentPagerAdapter;

import java.util.List;

import m.jclecai.com.base.BaseFragment;

/**
 * Created by ZD on 2017/6/27.
 */

public class AllRedPkgAdapter extends FragmentPagerAdapter {
    String[] title;
    List<BaseFragment> pages;

    public AllRedPkgAdapter(FragmentManager fm, List<BaseFragment> pages,String[] title) {
        super(fm);
        this.pages = pages;
        this.title = title;
    }

    @Override
    public Fragment getItem(int position) {
        return pages.get(position);
    }

    @Override
    public int getCount() {
        return pages.size();
    }

    @Override
    public CharSequence getPageTitle(int position) {
        return title == null ? null : title[position];
    }
}
